import request from "@/utils/request"

// 发货计划 列表
export function purchaseShipPlanList(data) {
  return request({
    url: `/v1/plan/purchase-ship-plan/list`,
    method: "post",
    data,
  })
}
// 发货计划 发货计划按周统计
export function purchaseShipPlanStatistics(params) {
  return request({
    url: `/v1/plan/purchase-ship-plan/statistics`,
    method: "get",
    params,
  })
}
// 发货计划 建单通知
export const purchaseShipPlanNotify = (data) =>
  request({
    url: "/v1/plan/purchase-ship-plan/notify",
    method: "post",
    data,
  })
// 发货计划 确认已发货
export const purchaseShipPlanStatusConfirm = (data) =>
  request({
    url: "/v1/plan/purchase-ship-plan/status-confirm",
    method: "post",
    data,
  })
// 发货计划 异常检测
export const purchaseShipPlanExceptionDetect = (data) =>
  request({
    url: "/v1/plan/purchase-ship-plan/exception-detect",
    method: "post",
    data,
  })
// 发货计划 异常信息删除
export const purchaseShipPlanExceptionCancel = (data) =>
  request({
    url: "/v1/plan/purchase-ship-plan/exception-cancel",
    method: "post",
    data,
  })

// 备料计划  列表
export const purchaseMaterialPlanList = (data) =>
  request({
    url: "/v1/plan/purchase-material-plan/list",
    method: "post",
    data,
  })
// 备料计划 创建
export const purchaseMaterialPlanCreate = (data) =>
  request({
    url: "/v1/plan/purchase-material-plan/create",
    method: "post",
    data,
  })
// 备料计划 编辑
export const purchaseMaterialPlanEdit = (data) =>
  request({
    url: "/v1/plan/purchase-material-plan/edit",
    method: "post",
    data,
  })
// 备料计划 审核
export const purchaseMaterialPlanVerify = (data) =>
  request({
    url: "/v1/plan/purchase-material-plan/verify",
    method: "post",
    data,
  })
// 备料计划 作废
export const purchaseMaterialPlanDiscard = (data) =>
  request({
    url: "/v1/plan/purchase-material-plan/discard",
    method: "post",
    data,
  })
// 备料计划 日志信息
export const purchaseMaterialPlanLog = (params) =>
  request({
    url: "/v1/plan/purchase-material-plan/log",
    method: "get",
    params,
  })

// // 获取字段映射关系
// export function getOption(params) {
//   return request({
//     url: `/v1/base/get-option`,
//     method: "get",
//     params,
//   });
// }

// //获取下拉选项数据
// export const overallOptions = (data) =>
//   request({
//     url: "/options",
//     method: "post",
//     data,
//   });

// 备货计划  列表
export const stockingPlanList = (data) =>
  request({
    url: "/v1/plan/stocking-plan/list",
    method: "post",
    data,
  })
// 备货计划  创建
export const stockingPlanCreate = (data) =>
  request({
    url: "/v1/plan/stocking-plan/create",
    method: "post",
    data,
  })
// 备货计划  详情
export const stockingPlanDetail = (data) =>
  request({
    url: "/v1/plan/stocking-plan/detail",
    method: "post",
    data,
  })
// 备货计划  作废计划
export const stockingPlanVoided = (data) =>
  request({
    url: "/v1/plan/stocking-plan/voided",
    method: "post",
    data,
  })
// 备货计划  操作日志
export const stockingPlanLog = (data) =>
  request({
    url: "/v1/plan/stocking-plan/log",
    method: "post",
    data,
  })
// 备货计划  备货计划总额
export const stockingPlanTotalAmount = (data) =>
  request({
    url: "/v1/plan/stocking-plan/total-amount",
    method: "post",
    data,
  })

// 备货计划明细 列表
export const planSpaList = (data) =>
  request({
    url: "/v1/plan/spa/list",
    method: "post",
    data,
  })
// 备货计划明细 批量审核
export const planSpaReview = (data) =>
  request({
    url: "/v1/plan/spa/review",
    method: "post",
    data,
  })
// 备货计划明细 删除
export const planSpaDelete = (data) =>
  request({
    url: "/v1/plan/spa/delete",
    method: "post",
    data,
  })
// 备货计划明细 修改备注
export const planSpaUpdateRemark = (data) =>
  request({
    url: "/v1/plan/spa/update-remark",
    method: "post",
    data,
  })
// 备货计划明细 修改运输类型
export const planSpaUpdateTransportationType = (data) =>
  request({
    url: "/v1/plan/spa/update-transportation-type",
    method: "post",
    data,
  })
// 备货计划明细 修改备货数量
export const planSpaUpdateStockinQuantity = (data) =>
  request({
    url: "/v1/plan/spa/update-stocking-quantity",
    method: "post",
    data,
  })

// 备货计划明细 添加备货计划商品
export const planSpaCreate = (data) =>
  request({
    url: "/v1/plan/spa/create",
    method: "post",
    data,
  })
// 备货计划明细 修改预计发货时间
export const planSpaUpdateShipTime = (data) =>
  request({
    url: "/v1/plan/spa/update-ship-time",
    method: "post",
    data,
  })
// 备货计划明细 明细日志
export const planSpaLog = (data) =>
  request({
    url: "/v1/plan/spa/log",
    method: "post",
    data,
  })

// 运营销售预测 列表
export const salesForecastList = (data) =>
  request({
    url: "/v1/plan/sales-forecast/list",
    method: "post",
    data,
  })
// 运营销售预测 日志
export const salesForecastLog = (data) =>
  request({
    url: "/v1/plan/sales-forecast/log",
    method: "post",
    data,
  })
// 运营销售预测 批量修改销量
export const salesForecastBatchUpdateSales = (data) =>
  request({
    url: "/v1/plan/sales-forecast/batch-update-sales",
    method: "post",
    data,
  })

// FBA备货分析 列表
export const stockingAnalysisList = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/list",
    method: "post",
    data,
  })

// FBA备货分析 批量设置备货参数
export const batchUpdateLtDays = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/batch-update-lt-days",
    method: "post",
    data,
  })
// FBA备货分析 批量设置备货状态
export const batchUpdateStockingStatus = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/batch-update-stocking-status",
    method: "post",
    data,
  })

// FBA备货分析 批量设置系统预估销量
export const batchUpdateEstimateSalesConfig = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/batch-update-estimate-sales-config",
    method: "post",
    data,
  })
// FBA备货分析 备货分析操作日志
export const stockingAnalysisLog = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/log",
    method: "post",
    data,
  })
// FBA备货分析 运营预测销量展示
export const operateDailyAverageSales = (data) =>
  request({
    url: "/v1/plan/stocking-analysis/operate-daily-average-sales",
    method: "post",
    data,
  })

// 备货计划变更管理 列表
export const spaChangeList = (data) =>
  request({
    url: "/v1/plan/spa-change/list",
    method: "post",
    data,
  })

// 备货计划变更管理 审核状态统计
export const spaChangeReviewStatus = (data) =>
  request({
    url: "/v1/plan/spa-change/review-status-statistics",
    method: "post",
    data,
  })
// 备货计划变更管理 详情
export const spaChangeDetail = (data) =>
  request({
    url: "/v1/plan/spa-change/detail",
    method: "post",
    data,
  })
// 备货计划变更管理 创建变更单
export const spaChangeCreate = (data) =>
  request({
    url: "/v1/plan/spa-change/create",
    method: "post",
    data,
  })
// 备货计划变更管理 修改变更单
export const spaChangeUpdate = (data) =>
  request({
    url: "/v1/plan/spa-change/update",
    method: "post",
    data,
  })

// 备货计划变更管理 批量审核
export const spaChangeReview = (data) =>
  request({
    url: "/v1/plan/spa-change/review",
    method: "post",
    data,
  })

// 备货计划变更管理 操作日志
export const spaChangeLog = (data) =>
  request({
    url: "/v1/plan/spa-change/log",
    method: "post",
    data,
  })

// asin销量趋势
export const salesTrend = (data) =>
  request({
    url: "/v1/plan/sales-forecast/sales-trend",
    method: "post",
    data,
  })

//
export const forecastimport = (data) =>
  request({
    url: "/v1/plan/sales-forecast/import",
    method: "post",
    data,
    responseType: "arraybuffer",
  })
